Loading
Scriptbox
 VBScript Links 
 About VBscript 
 JavaScript Links 
 About JavaScript 
 Powershell Links 
 PSCRIPT the Script Launcher 
 PowerShell Shortcut Keys 
 About Powershell 
     VBScript
    JavaScript
    Powershell
Disclaimer
Contact
Latest 10 Scripts
Script search
  :: { Category } :: 0-9ABCDEFGHIJKLMNOPQRSTUVWXYZ
         

Search Options:  Modify  a  Text  File  and  Then  Extract  Selected  Lines  From  the  Modified  Contents  

 Content of Modify a Text File and Then Extract Selected Lines From the Modified Contents.vbs
MD5 Hash: EB1DFC636BEFA17C1EF8E9C2782937D2
Const ForReading = 1

Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFile = objFSO.OpenTextFile("C:\Scripts\Test.txt", ForReading)

strContents = objFile.ReadAll
objFile.Close

strContents = Replace(strContents, "~", "~" & vbCrLf)

arrLines =Split(strContents, vbCrLf)

For Each strLine in arrLines
If Left(strLine, 2) = "N9" or Left(strLine, 2) = "B4" Then
strNewFile = strNewFile & strLine & vbCrLf
End If
Next

Set objFile = objFSO.CreateTextFile("C:\Scripts\Test2.txt")
objFile.Write strNewFile
objFile.Close



   © 2008 - 2013 Boris Toll      :: Scripts available: 6.481 ::      :: scriptbox.toll.at ::      :: powered by www.toll.at ::
  Google Entries:n/a
  Yahoo Backlinks:n/a
  Live Backlinks:n/a
  del.icio.us Bookmarks:n/a
  Technorati Links:n/a